import { defaultRequest as rq } from "./request";
import type { R } from "./request";

/**
 * 路由列表
 */
export const routesApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/gateway/dr/routes", { params });
};

/**
 * 路由ID列表
 */
export const routeIdsApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/gateway/dr/routeids", { params });
};

export const routeInfoApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/gateway/dr/route", { params });
};

export const routeRefreshApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/gateway/dr/refresh", { params });
};

export const globalFiltersApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/gateway/dr/globalfilters", { params });
};

export const routeFiltersApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/gateway/dr/routefilters", { params });
};